As computer environments become more and more complex, resources which were once taken for granted become a precious commodity. This is true today for virtual address space in the OS/2 operating system (OS/2 is a trademark of International Business Machines Corporation) environment where more and larger application programs require significant quantities of memory. The operating system itself requires more storage to properly manage and protect these applications.
The architecture of the x86 series of processor by the Intel Corporation (on which OS/2 is based) provides four distinct privilege levels at the hardware level. These range from Ring 0, the most trusted privilege level, to Ring 3, or application privilege level (Ring 1 is currently not used by OS/2). Privilege levels are used to improve reliability of the operating system by protecting resources from direct access by less trusted entities. Each of these privilege levels require unique resources which are pre-allocated and stored away for subsequent use upon ring transition.
Under OS/2, the Ring 2 privilege level is used to provide the input/output privilege level (IOPL), i.e. the privilege level or lower privilege levels in which code must be executing to be allowed by the Intel hardware to execute "sensitive" instructions. These sensitive instructions are typically used to manage physical devices and include, but are not limited to, I/O and interrupt servicing instructions, and are primarily useful for device-oriented situations where an application needs to query device status. The Applicants have determined that this ability is not required by the majority of tasks which come and go in a typical operational environment. Therefore, as will be described in the specification below, it is advantageous to delay the allocation of resources required for the Ring 2 stack segment until such time as they are actually required to reduce the amount of virtual memory allocated.